import 'dart:convert';

import 'package:star_author/generated/json/base/json_field.dart';
import 'package:star_author/generated/json/wallet_automatic_list_item_entity.g.dart';

@JsonSerializable()
class WalletAutomaticListItemEntity {
  int? id;
  String? status;
  @JSONField(name: "created_at")
  String? createdAt;
  String? detail;
  @JSONField(name: "cash_amt")
  String? cashAmt;

  WalletAutomaticListItemEntity();

  factory WalletAutomaticListItemEntity.fromJson(Map<String, dynamic> json) =>
      $WalletAutomaticListItemEntityFromJson(json);

  Map<String, dynamic> toJson() => $WalletAutomaticListItemEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }

  static fromJsonList(List jsonRes) {
    return jsonRes
        .map((e) => WalletAutomaticListItemEntity.fromJson(e))
        .toList();
  }
}
